<?php

class  admin extends main{

    function __construct() {
        parent::__construct();
    }

    function index() {
        // 强制至少一个月内修改一次密码
        if($_SESSION['adminmanager']['user_last_reset'] >= strtotime('-30 day')){
            if(!is_file(DATA_PATH."cache/menu-".$_SESSION['adminmanager']['group_id'].".tmp.php")){
                $this->loadModel('g5_admin_menu');
                $this->g5_admin_menu->makecache();
            }
            $menus = include DATA_PATH."cache/group_".$_SESSION['adminmanager']['group_id']."_menu.php";
        }else{
            if( ! isset($_SESSION['update_password'])){
                 $_SESSION['update_password'] = TRUE;
                 $this->report($this->systemLang['userSecurity'],BASEURI.'admin/index');
            }
            $menus = include DATA_PATH."cache/group_17_menu.php";
        }
        $this->user = $_SESSION['adminmanager'];
		$this->menu_1		=	isset($menus['parent']) ? $menus['parent']: array();
		$this->menu_2		=	isset($menus['child']) ? $menus['child'] : array();
        //print_r(get_object_vars($this));exit;
        
        $this->display('index');
    }

    function main() {
        $this->user = $_SESSION['adminmanager'];
        $this->display('main');
    }
}